*** Settings ***
Library           Selenium2Library
Resource          ../../CommonVars/Locations/SITSYS/MoudleView/LMenuView/LMenuVIew.robot
Resource          ../OpProposal/OpFloatButtonPart/Op 点击按钮.robot
Resource          ../OpElements/OpElements.robot
Resource          ../OpElements/COMM_JS.robot

*** Keywords ***
Go Proposal Menu
    [Arguments]    ${BNewQuotation}    # 投保管理菜单 \ ${BNewQuotation}:是否新增报价
    [Documentation]    投保管理菜单
    ...    ${LProposalManage} | ${LNewQuotation} | ${LQueryQuotation}
    ...
    ...    ${BNewQuotation}:是否新增报价： 是 \ 点击新增报价菜单
    ...    \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 否 \ 点击投保查询菜单
    # 点击投保管理 \ 判断点击情况：class 中是否有 \ treeview active    #True:点击报价管理 \ menuUrl active \ \ FALSE:点击投保查询 \ \ menuUrl active    # 步骤拆解
    # 新增报价 投保查询
    ${newqClass}=    Get Element Attribute    ${LNewQuotation}    class
    ${queClass}=    Get Element Attribute    ${LQueryQuotation}    class
    FOR    ${var}    IN RANGE    0    9999
        Run Keyword If    ${BNewQuotation}== 1    RUN KEYWORDS    Go Menu Manager    ${LProposalManage}
        ...    AND    Click Element    ${LNewQuotation}
        ...    ELSE IF    ${BNewQuotation} != 1    RUN KEYWORDS    Go Menu Manager    ${LProposalManage}
        ...    AND    Click Element    ${LQueryQuotation}
        ${newqClass}=    Get Element Attribute    ${LNewQuotation}    class
        ${queClass}=    Get Element Attribute    ${LQueryQuotation}    class
        Exit For Loop If    'active' in '${newqClass}' or 'active' in '${queClass}'
    END
    加载    ${Loading}
